import axios from '../AxiosConfig.js'

export const createShovel = (data) => {
    return axios({
        method: 'put',
        url: '/api/parameters/shovel/' + encodeURIComponent(data.vhost) +'/' + encodeURIComponent(data.name),
        data: data
    })
}

export const selectShovel = (vhost, name) => {
    return axios({
        method: 'get',
        url: '/api/parameters/shovel/' + encodeURIComponent(vhost) +'/' + encodeURIComponent(name),
    })
}

export const listShovel = () => {
    return axios({
        method: 'get',
        url: '/api/parameters/shovel'
    })
}

export const listShovelStatus = () => {
    return axios({
        method: 'get',
        url: '/api/shovels'
    })
}

export const deleteShovel = (vhost, name) => {
    return axios({
        method: 'delete',
        url: '/api/shovels/vhost/' + encodeURIComponent(vhost) +'/' + encodeURIComponent(name),
    })
}

export const restartShovel = (vhost, name) => {
    return axios({
        method: 'delete',
        url: '/api/shovels/vhost/' + encodeURIComponent(vhost) +'/' + encodeURIComponent(name) + '/restart',
    })
}


